﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum ELocationType
{
	E_None = 0,
	E_Interior = 1 << 0,
	E_Exterior = 1 << 1,
	E_Enter = 1 << 2,//4
	E_Exit = 1 << 3,//8
	E_EnterOrExit = E_Enter | E_Exit,//12
	E_NormalSorting = 1 << 4,//16
	E_UnNormalSorting = 1 << 5,//32
	E_SortingLine = E_NormalSorting | E_UnNormalSorting,//48
}

public enum EWarningLevel
{
	E_None,
	E_Level1,
	E_Level2,
	E_Level3
}

public class GlobalValue
{
	public static double MaxLimitTemperature = 50;
	public static double MinLimitTemperature = 0;
	public static double MaxLimitHumidity = 50;
	public static double MinLimitHumidity = 0;
}

public class EventName
{
	public const string LocationSelect = "LocationSelect";
	public const string OnLocationClicked = "OnLocationClicked";

	#region EnterOrExit
	public const string CurrentTemperatureUpdate = "CurrentTemperatoreUpdate";
	public const string CurrentHumidityUpdate = "CurrentHumidityUpdate";
	public const string CurrentRepertoryUpdate = "CurrentRepertoryUpdate";
	public const string CurrStockInOrOutUpdate = "CurrStockInOrOutUpdate";

	public const string RecordHumitureUpdate = "RecordHumitureUpdate";
	public const string RecordRepertoryUpdate = "RecordRepertoryUpdate";
	public const string RecordStockInOrOutUpdate = "RecordStockInOrOutUpdate";

	#endregion

	#region Sorting Line
	public const string CurrentEnergyConsumptionUpdate = "CurrentEnergyConsumptionUpdate";
	public const string CurrentSortingLineDataUpdate = "CurrentSortingLineDataUpdate";
	public const string CurrentSortingCheckUpdate = "CurrentSortingCheckUpdate";

	public const string RecordEnergyConsumptionUpdate = "RecordEnergyConsumptionUpdate";
	public const string RecordSortingLineDataUpdate = "RecordSortingLineDataUpdate";
	public const string RecordSortingCheckUpdate = "RecordSortingCheckUpdate";
	#endregion

	#region OverView
	public const string CurrentVisitorUpdate = "CurrentVisitorUpdate";
	public const string CurrentAirPressureUpdate = "CurrentAirPressureUpdate";
	public const string CurrentVoltageUpdate = "CurrentVoltageUpdate";

	public const string RecordVisitorUpdate = "RecordVisitorUpdate";
	public const string RecordAirPressureUpdate = "RecordAirPressureUpdate";
	public const string RecordVoltageUpdate = "RecordVoltageUpdate";

	public const string VisitorRefreshTimeUpdate = "VisitorRefreshTimeUpdate";
	public const string AirPressureRefreshTimeUpdate = "AirPressureRefreshTimeUpdate";
	public const string VoltageRefreshTimeUpdate = "VoltageRefreshTimeUpdate";
	#endregion

	#region OverView2
	public const string OverView2CurrentEnergyUpdate = "OverView2CurrentEnergyUpdate";
	public const string OverView2CurrentSortingDataUpdate = "OverView2CurrentSortingDataUpdate";
	public const string OverView2RecordWorkOrderUpdate = "OverView2RecordWorkOrderUpdate";
	#endregion
}

public static class JsonFildName
{
	private static Dictionary<string, string> s_mDicSon2Dad = new Dictionary<string, string>
	{
		//warehouse
		{ JsonFildName.Warehouse.Current_Temperature ,JsonFildName.Warehouse.Temperature },
		{ JsonFildName.Warehouse.Record_Temperature ,JsonFildName.Warehouse.Temperature },
		{ JsonFildName.Warehouse.TemperatureRefreshTime ,JsonFildName.Warehouse.Temperature },
		{ JsonFildName.Warehouse.Current_Humidity ,JsonFildName.Warehouse.Humidity },
		{ JsonFildName.Warehouse.Record_Humidity ,JsonFildName.Warehouse.Humidity },
		{ JsonFildName.Warehouse.HumidityRefreshTime ,JsonFildName.Warehouse.Humidity },
		{ JsonFildName.Warehouse.Current_Repertory ,JsonFildName.Warehouse.Repertory },
		{ JsonFildName.Warehouse.Record_Repertory ,JsonFildName.Warehouse.Repertory },
		{ JsonFildName.Warehouse.RepertoryRefreshTime ,JsonFildName.Warehouse.Repertory },
		{ JsonFildName.Warehouse.Current_StockInOrOut ,JsonFildName.Warehouse.StockInOrOut },
		{ JsonFildName.Warehouse.Record_StockInOrOut ,JsonFildName.Warehouse.StockInOrOut },
		{ JsonFildName.Warehouse.StockInOrOutRefreshTime ,JsonFildName.Warehouse.StockInOrOut },
		//sortingline
		{ JsonFildName.SortingLine.Current_EnergyConsumption ,JsonFildName.SortingLine.EnergyConsumption },
		{ JsonFildName.SortingLine.Record_EnergyConsumption ,JsonFildName.SortingLine.EnergyConsumption },
		{ JsonFildName.SortingLine.EnergyConsumptionRefreshTime ,JsonFildName.SortingLine.EnergyConsumption },
		{ JsonFildName.SortingLine.Current_SortingLineData ,JsonFildName.SortingLine.SortingLineData },
		{ JsonFildName.SortingLine.Record_SortingCount ,JsonFildName.SortingLine.SortingLineData },
		{ JsonFildName.SortingLine.Record_SortingDuration ,JsonFildName.SortingLine.SortingLineData },
		{ JsonFildName.SortingLine.Record_SortingEfficient ,JsonFildName.SortingLine.SortingLineData },
		{ JsonFildName.SortingLine.SortingLineDataRefreshTime ,JsonFildName.SortingLine.SortingLineData },
		{ JsonFildName.SortingLine.Current_SortingCheck ,JsonFildName.SortingLine.Check },
		{ JsonFildName.SortingLine.Record_SortingCheck ,JsonFildName.SortingLine.Check },
		{ JsonFildName.SortingLine.CheckRefreshTime ,JsonFildName.SortingLine.Check },

		//overview
		{ JsonFildName.OverView.Current_Visitor ,JsonFildName.OverView.Visitor },
		{ JsonFildName.OverView.Current_AirPressure ,JsonFildName.OverView.AirPressure },
		{ JsonFildName.OverView.Current_Voltage ,JsonFildName.OverView.Voltage },
		{ JsonFildName.OverView.Record_Visitor ,JsonFildName.OverView.Visitor },
		{ JsonFildName.OverView.Record_AirPressure ,JsonFildName.OverView.AirPressure },
		{ JsonFildName.OverView.Record_Voltage ,JsonFildName.OverView.Voltage },
		{ JsonFildName.OverView.VisitorRefreshTime ,JsonFildName.OverView.Visitor },
		{ JsonFildName.OverView.AirPressureRefreshTime ,JsonFildName.OverView.AirPressure },
		{ JsonFildName.OverView.VoltageRefreshTime ,JsonFildName.OverView.Voltage },

	};

	public static string GetDadFieldName(string strSonName)
	{
		if (s_mDicSon2Dad.ContainsKey(strSonName))
		{
			return s_mDicSon2Dad[strSonName];
		}
		return "None";
	}
	public static class Common
	{
		public const string Timestamp = "Timestamp";
		public const string Efficient = "Efficient";
	}

	#region Warehouse
	public static class Warehouse
	{

		/*Warehouse
		 *			Temperature
		 *						CurrentTemperature
		 *						RecordTemperature(Array)
		 *											Temperature
		 *											Timestamp
		 *						TemperatureRefreshTime
		 *			Humidity
		 *						CurrentHumidity
		 *						RecordHumidity(Array)
		 *											Humidity
		 *											Timestamp
		 *						HumidityRefreshTime
		 *			Repertory
		 *						CurrentRepertory
		 *											TotalRepertoryInBuff
		 *											TotalRepertoryInStore
		 *						RecordRepertory(Array)
		 *											RepertoryInBuff
		 *											RepertoryInStore
		 *											Timestamp
		 *						RepertoryRefreshTime
		 *						
		 *			StockInOrOut
		 *						CurrentStockInOrOut
		 *											InOrOutCount
		 *											InOrOutEfficient
		 *						RecordStock(Array)
		 *											Efficient
		 *											Average
		 *						StockInOrOutRefreshTime
		 * 
		 */

		public const string Temperature = "Temperature";
		public const string Record_Temperature = "RecordTemperature";
		public const string Current_Temperature = "CurrentTemperature";
		public const string TemperatureRefreshTime = "TemperatureRefreshTime";
		public const string Humidity = "Humidity";
		public const string Record_Humidity = "RecordHumidity";
		public const string Current_Humidity = "CurrentHumidity";
		public const string HumidityRefreshTime = "HumidityRefreshTime";
		public const string Repertory = "Repertory";
		public const string Current_Repertory = "CurrentRepertory";
		public const string TotalRepertoryInBuff = "TotalRepertoryInBuff";
		public const string TotalRepertoryInStore = "TotalRepertoryInStore";
		public const string Record_Repertory = "RecordRepertory";
		public const string RepertoryInBuff = "RepertoryInBuff";
		public const string RepertoryInStore = "RepertoryInStore";
		public const string RepertoryRefreshTime = "RepertoryRefreshTime";
		public const string StockInOrOut = "StockInOrOut";
		public const string Current_StockInOrOut = "CurrentStockInOrOut";
		public const string InOrOutCount = "InOrOutCount";
		public const string InOrOutEfficient = "InOrOutEfficient";
		public const string Record_StockInOrOut = "StockInOrOut";
		public const string Average = "Average";
		public const string StockInOrOutRefreshTime = "StockInOrOutRefreshTime";
	}
	#endregion

	#region SortingLine
	public static class SortingLine
	{
		
		/*SortingLine
		 *				EnergyConsumption
		 *									CurrentEnergyConsumption
		 *									RecordEnergyConsumption(Array)
		 *																	EnergyConsumpption
		 *																	Timestamp
		 *									EnergyConsumptionRefreshTime
		 *				SortingLineData
		 *									CurrentSortingLineData
		 *																	SortingCountInPlan
		 *																	SortingCountInCompleted					
		 *																	SortingDuration
		 *																	SortingEfficient
		 *									RecordSortingEfficient(Array)
		 *																	SortingEfficient
		 *																	Timestamp
		 *									RecordSortingDuration(Array)
		 *																	SortingDuration
		 *																	Timestamp
		 *									RecordSortingCount(Array)
		 *																	SortingCountInCompleted
		 *																	SortingCountInPlan
		 *																	SortingCountMaxThatDay
		 *																	Timestamp
		 *									SortlineLineDataRefreshTime
		 *									
		 *				Check
		 *									CurrentSortingCheck
		 *																	SortingCheckInPlan
		 *																	SortingCheckInCompleted
		 *									RecordSortingCheck(Array)
		 *																	SortingCheckInPlan
		 *																	SortingCheckInCompleted
		 *																	Timestamp
		 *									CheckRefreshTime
		 * 
		 */
		public const string EnergyConsumption = "EnergyConsumption";
		public const string Current_EnergyConsumption = "CurrentEnergyConsumption";
		public const string Record_EnergyConsumption = "RecordEnergyConsumption";
		public const string EnergyConsumptionRefreshTime = "EnergyConsumptionRefreshTime";
		public const string SortingLineData = "SortingLineData";
		public const string Current_SortingLineData = "CurrentSortingLineData";
		public const string Record_SortingEfficient = "RecordSortingEfficient";
		public const string SortingEfficient = "SortingEfficient";
		public const string Record_SortingDuration = "RecordSortingDuration";
		public const string SortingDuration = "SortingDuration";
		public const string Record_SortingCount = "RecordSortingCount";
		public const string SortingCountInCompleted = "SortingCountInCompleted";
		public const string SortingCountInPlan = "SortingCountInPlan";
		public const string SortingCountMaxThatDay = "SortingCountMaxThatDay";
		public const string SortingLineDataRefreshTime = "SortingLineDataRefreshTime";
		public const string Check = "Check";
		public const string Current_SortingCheck = "CurrentSortingCheck";
		public const string SortingCheckInPlan = "SortingCheckInPlan";
		public const string SortingCheckInCompleted = "SortingCheckInCompleted";
		public const string Record_SortingCheck = "RecordSortingCheck";
		public const string CheckRefreshTime = "CheckRefreshTime";


		
	}
	#endregion

	#region Overview
	public static class OverView
	{
		/*
		 * Visitor
		 *					CurrentVisitor
		 *										VisitorCount
		 *										GuestVisitorCount
		 *										StaffVisitorCount
		 *										CarVisitorCount
		 *					RecordVisitor
		 *										VisitorCount
		 *										Timestamp
		 *					VisitorRefreshTime
		 * AirPressure
		 *					CurrentAirPressure
		 *					RecordAirPressure
		 *										AirPressure
		 *										Timestamp
		 *					AirPressureRefreshTime
		 * Voltage
		 *					CurrentVoltage
		 *					RecordVoltage
		 *										Votage
		 *										Timestamp
		 *					VoltageRefreshTime
		 */

		public const string Visitor = "Visitor";
		public const string Current_Visitor = "CurrentVisitor";
		public const string VisitorCount = "VisitorCount";
		public const string GuestVisitorCount = "GuestVisitorCount";
		public const string StaffVisitorCount = "StaffVisitorCount";
		public const string CarVisitorCount = "CarVisitorCount";
		public const string Record_Visitor = "RecordVisitor";
		public const string VisitorRefreshTime = "VisitorRefreshTime";
		public const string AirPressure = "AirPressure";
		public const string Current_AirPressure = "CurrentAirPressure";
		public const string Record_AirPressure = "RecordAirPressure";
		public const string AirPressureRefreshTime = "AirPressureRefreshTime";
		public const string Voltage = "Voltage";
		public const string Current_Voltage = "CurrentVoltage";
		public const string Record_Voltage = "RecordVoltage";
		public const string VoltageRefreshTime = "VoltageRefreshTime";


	}

	#endregion

	#region Overview2
	#endregion
}

public static class RecordCount
{
	public const int RecordHumiture_1 = 6;
	public const int RecordHumiture_2 = 12;
	public const int RecordRepertory = 7;
	public const int RecordStockInOrOut = 7;

	public const int RecordEnergyConsumption_1 = 6;
	public const int RecordEnergyConsumption_2 = 12;
	public const int RecordSortingData_1 = 7;
	public const int RecordSortingData_2 = 14;
	public const int RecordSortingCheck = 7;

	public const int RecordVisitor_1 = 7;
	public const int RecordVisitor_2 = 14;
	public const int RecordAirPressure_1 = 7;
	public const int RecordAirPressure_2 = 14;
	public const int RecordVoltage_1 = 7;
	public const int RecordVoltage_2 = 14;




	
}

public class Event_LocationSelect
{
	public int LocationID;
}

public class Event_Waring
{
	public int WaringType;
	public int LocationID;
}

public class Event_CurrentTemperatureUpdate
{

}

public class Event_CurrentHumidityUpdate
{

}

public class Event_CurrentRepertoryUpdate
{

}

public class Event_CurrentStockInOrOutUpdate
{

}

public class Event_RecordHumitureUpdate
{

}

public class Event_RecordRepertoryUpdate
{

}

public class Event_RecordStockInOrOutUpdate
{

}

#region Sortingline
public class Event_CurrentEnergyConsumptionUpdate
{

}

public class Event_RecordEnergyConsumptionUpdate
{

}

public class Event_CurrentSortingLineDataUpdate
{

}

public class Event_RecordSortingLineDataUpdate
{

}

public class Event_CurrentSortingCheckUpdate
{

}

public class Event_RecordSortingCheckUpdate
{

}
#endregion

#region Overview
public class Event_CurrentVisitorUpdate
{

}public class Event_CurrentAirPressureUpdate
{

}public class Event_CurrentVoltageUpdate
{

}
public class Event_RecordVisitorUpdate
{

}public class Event_RecordAirPressureUpdate
{

}public class Event_RecordVoltageUpdate
{

}

#endregion